import request from '@/utils/request'

// 查询公告列表
export function listNotice(query) {
  return request({
    url: '/system/notice/list',
    method: 'get',
    params: query
  })
}
// 查询公开公告列表
export function Opennoticemylist(query) {
  return request({
    url: '/noToken/notice/mylist',
    method: 'get',
    params: query
  })
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'get'
  })
}
// 查询公告详细
export function noticeread(id) {
  return request({
    url: '/notice/read/' + id,
    method: 'POST'
  })
}
// 查询公告详细
export function systemnotice(id) {
  return request({
    url: '/system/notice/' + id,
    method: 'get'
  })
}
// 查询公告详细
export function noticemylist(query) {
  return request({
    url: '/notice/mylist',
    method: 'get',
    params: query
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/system/notice',
    method: 'post',
    data: data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/system/notice',
    method: 'put',
    data: data
  })
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: '/system/notice/' + noticeId,
    method: 'delete'
  })
}
// 删除我的通知列表
export function noticeRead(noticeId) {
  return request({
    url: '/notice/read/' + noticeId,
    method: 'delete'
  })
}
